package org.dromara.iot.domain.vo;

import java.util.Date;

import org.dromara.common.translation.annotation.Translation;
import org.dromara.common.translation.constant.TransConstant;
import org.dromara.iot.domain.IotElevatorEvent;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;

import java.io.Serial;
import java.io.Serializable;


/**
 * 电梯事件视图对象 iot_elevator_event
 *
 * @author lsl
 * @date 2025-04-16
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = IotElevatorEvent.class)
public class IotElevatorEventVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 事件ID
     */
    @ExcelProperty(value = "事件ID")
    private String eventId;

    /**
     * 事件单号（对应eventid，抓拍时间+事件类型）
     */
    @ExcelProperty(value = "事件单号", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "对=应eventid，抓拍时间+事件类型")
    private String eventCode;

    /**
     * 设备ID（对应devid）
     */
    @ExcelProperty(value = "设备ID", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "对=应devid")
    private String deviceId;

    /**
     * 事件类型（按位掩码存储，对应event字段）
     */
    @ExcelProperty(value = "事件类型", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "按=位掩码存储，对应event字段")
    private Integer eventType;

    /**
     * 门状态 0=关闭 1=打开 2=未知（dooropen）
     */
    @ExcelProperty(value = "门状态 0=关闭 1=打开 2=未知", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "d=ooropen")
    private Integer doorStatus;

    /**
     * 电瓶车状态 0=无 1=有（motostatus）
     */
    @ExcelProperty(value = "电瓶车状态 0=无 1=有", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "m=otostatus")
    private Integer motorcycleStatus;

    /**
     * 轿厢人数（personcount）
     */
    @ExcelProperty(value = "轿厢人数", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "p=ersoncount")
    private Integer personCount;

    /**
     * 上报时间（timestamp转换）
     */
    @ExcelProperty(value = "上报时间", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "t=imestamp转换")
    private Date reportTime;

    /**
     * 平层状态 0=非平层 1=平层（elevstatus.levelingstatus）
     */
    @ExcelProperty(value = "平层状态 0=非平层 1=平层", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "e=levstatus.levelingstatus")
    private Integer levelingStatus;

    /**
     * 运行速度 cm/s（elevstatus.speed）
     */
    @ExcelProperty(value = "运行速度 cm/s", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "e=levstatus.speed")
    private Integer runSpeed;

    /**
     * 气压值 Pa（elevstatus.press）
     */
    @ExcelProperty(value = "气压值 Pa", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "e=levstatus.press")
    private Integer airPressure;

    /**
     * 实际楼层（elevstatus.elevactpos）
     */
    @ExcelProperty(value = "实际楼层", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "e=levstatus.elevactpos")
    private Integer currentFloor;

    /**
     * 楼层名称（elevstatus.elevname）
     */
    @ExcelProperty(value = "楼层名称", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "e=levstatus.elevname")
    private String floorName;

    /**
     * 累计运行次数（acinfo.acelevtimes）
     */
    @ExcelProperty(value = "累计运行次数", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "a=cinfo.acelevtimes")
    private Integer acOperationCount;

    /**
     * 累计开门次数（acinfo.acopentimes）
     */
    @ExcelProperty(value = "累计开门次数", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "a=cinfo.acopentimes")
    private Integer acOpenCount;

    /**
     * 累计里程 单位米（acinfo.acmile）
     */
    @ExcelProperty(value = "累计里程 单位米", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "a=cinfo.acmile")
    private Integer acMileage;

    /**
     * 累计运行时间 秒（acinfo.actime）
     */
    @ExcelProperty(value = "累计运行时间 秒", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "a=cinfo.actime")
    private Integer acRunDuration;

    /**
     * 异常声音 0=无 1=有（event包含2048时设置）
     */
    @ExcelProperty(value = "异常声音 0=无 1=有", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "e=vent包含2048时设置")
    private Integer abnormalSound;

    /**
     * 急停状态 0=正常 1=急停（event包含4194304时设置）
     */
    @ExcelProperty(value = "急停状态 0=正常 1=急停", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "e=vent包含4194304时设置")
    private Integer emergencyStop;

    /**
     * 数据签名（对应sign）
     */
    @ExcelProperty(value = "数据签名", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "对=应sign")
    private String signature;

    /**
     * 随机数（对应nonce）
     */
    @ExcelProperty(value = "随机数", converter = ExcelDictConvert.class)
    @ExcelDictFormat(readConverterExp = "对=应nonce")
    private String nonce;

    /**
     * 关联图片文件ID
     */
    @ExcelProperty(value = "关联图片文件ID")
    @Translation(type = TransConstant.OSS_ID_TO_URL)
    private Long ossId;

    /**
     * 关联电梯ID
     */
    @ExcelProperty(value = "关联电梯ID")
    private Long elevatorId;

    /**
     * 电梯名称
     */
    @ExcelProperty(value = "电梯名称")
    private String elevatorName;

    /**
     * 使用单位
     */
    @ExcelProperty(value = "使用单位")
    private String useUnit;

    /**
     * 维保单位
     */
    @ExcelProperty(value = "维保单位")
    private String serverUnit;

    /**
     * 告警解除时间
     */
    @ExcelProperty(value = "告警解除时间")
    private Date removeTime;

    /**
     * 持续时长(秒)
     */
    @ExcelProperty(value = "持续时长(秒)")
    private Long eventDuration;

    /**
     * 备注
     */
    @ExcelProperty(value = "备注")
    private String remark;
    
    private IotElevatorVo elevator;
}
